package string;

/**
 * String和StringBuilder的区别
 */
public class StringAndStringBuilderDemo {
    public static void main(String[] args) {
        /*
        //String不适合频繁修改内容(效率低)
        String s="a";
        for (int i = 0; i < 10000000; i++) {
            s=s+i;
        }
        System.out.println("执行完毕");
        */

        StringBuilder builder=new StringBuilder("a");
        for (int i = 0; i <10000000 ; i++) {
            builder.append(i);
        }
        System.out.println("执行完毕");
    }

}
